Reader: Improve user hovercard performance by using custom implementation#109865
Conversation
Jetpack Cloud Live (direct link)
Automattic for Agencies Live (direct link)
Dashboard Live (dotcom) (direct link)
|
9f34e52 to
0ea831b
Compare
…EAD-460/improve-performance-of-gravatar-hovercard
be09f85 to
b1924c3
Compare
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
mehmoodak
left a comment
There was a problem hiding this comment.
Added comments for easier review.
| <header className="user-profile-header"> | ||
| <div className="user-profile-header__user-info"> | ||
| <UserAvatar user={ user } iconSize={ 56 } /> | ||
| <UserAvatar user={ user } size={ 56 } hideHovercard /> |
There was a problem hiding this comment.
Do not display hovercard on header of user profile page.
There was a problem hiding this comment.
PreloadedImage is a wrapper around the HTML img element which only displays the image once it has been fully loaded. This is useful to prevent layout shifts and display a placeholder while the image is loading.
Currently only using it on the avatar of hovercard but have plan to use it more in Reader codebase.
There was a problem hiding this comment.
Have made following changes in file. The functionality of the file is mostly same as before.
- Converted the file to TypeScript.
- Updated the code to use the data coming from parent instead of request our own. (this comes from
v1.1/usersendpoint)
There was a problem hiding this comment.
Styles are moved from a single file to their dedicated component files. Most of the styles are same as before.
There was a problem hiding this comment.
Styles are moved from a single file to their dedicated component files. Most of the styles are same as before.
There was a problem hiding this comment.
Styles are moved from a single file to their dedicated component files. Most of the styles are same as before.
There was a problem hiding this comment.
TanStack query to fetch info from Gravatar API. We'll only use this if we don't have a WPCOM user ID or login.
There was a problem hiding this comment.
Have made following changes in file. The functionality of the file is mostly same as before.
- Converted the file to TypeScript.
- Updated the code to use the data coming from parent instead of request our own. (this comes from
v1.1/usersendpoint)

Closes: READ-460
Before reviewing this review: #109718, #109846, #109854 (and then a rebase with trunk will be needed)
Proposed Changes
Here is the comparison video that shows improvements in WPCOM user hovercards (notice speed, better data and less layout shifts)
Screen.Recording.2026-04-08.at.6.32.57.AM.mov
Why are these changes being made?
On user avatars we were displaying Gravatar Hovercards. It does work but offers no control, makes extra API calls, had layout shifts and often times show incomplete data. Sometimes displaying hovercard takes 3s-7s which affects UX.
To avoid all of above we have move towards a custom implementation which offers:
v1.1/users1endpoint to send most of the data in 1 API call.After all of above changes WPCOM user hovercards will display instantly (<0.1s) while non-WPCOM user hovercard will appear slightly fast (~2s - 3s).
Testing Instructions
We are using
UserAvatarin following places. Test that each avatar is working as expected.Pre-merge Checklist